﻿using System.ComponentModel;
using TestImpresion.Annotations;
using TestImpresion.Clases;

namespace TestImpresion
{
    public class FormularioBase : INotifyPropertyChanged
    {
        private ImprentaFormulario _parentImprenta;
        public ImprentaFormulario ParentImprenta
        {
            get { return _parentImprenta; }
            set
            {
                this._parentImprenta = value;
                NotifyPropertyChanged("ParentImprenta");
            }
        }

        protected FormularioBase(ImprentaFormulario parent)
        {
            this.ParentImprenta = parent;
        }

        protected FormularioBase()
        {
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
